Computational Thinking

Algorithm

Unambiguous instructions designed in order to solve a problem or achieve a certain goal in a finite number of steps.

  • Input and Output
  • Finiteness(finite number of step)
  • Effectiveness

==concatenation==: combine strings

abstraction

subprocedure/function/method - advantage: saves time; easy to understand; easy to test (unit test); enable concurrent development

pre-condition

implementation

Standard Algorithms

sequential search

binary search

bubble sort (and [[Option D#^795d09 | how to improve]])

swap/selection sort

how to present an algorithm

  • Natural language
  • flow chart
  • Pseudocode
  • trace table
  • programming language

flow chart example: ![[UWC/CS/_resources/Pasted image 20240913102754.png]]

What is computational thinking

![[UWC/CS/_resources/Pasted image 20240913110014.png]]

Language

compilation: all code translated to machine code before running

intepretation: one line after another translated to machine code during runtime

Java uses virtual machine (first compile and run in virtual machine)